package com.wondertek.poms.dao.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Proxy;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


@Data
@Entity
@Table(name = "IMAGE")
@DynamicUpdate
@DynamicInsert
@Proxy(lazy = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Image implements Serializable {
	private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO, generator = "IMAGE_SEQ")
    @SequenceGenerator(name="IMAGE_SEQ", allocationSize = 1, sequenceName = "IMAGE_SEQ")
    @Column(name="IMGID")
    private Long imgId;
    private String name;
    private String catalog;
    private String author;
    private String alt;
    private String description;
    private String tags;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name="ORG_DATE")
    private Date orgDate;
    private String format;
    private Long width;
    private Long height;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "CREATE_TIME")
    private Date createTime = new Date();
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "UPDATE_TIME")
    private Date updateTime;
    @Column(name="FILE_SIZE")
    private Long fileSize;
    @Column(name="FILE_TYPE")
    private String fileType;
    private String src;
    @Column(name="FILE_PATH")
    private String filePath;
    @Column(name="USER_OBJECT_CONTENT_ID")
    private Long userObjectContentId;
//    private Long fileState = 200L;
    /**生产上确认*/
    @Column(name="ID_TEMP")
    private String idTemp;
    private Integer type;
    @Column(name = "VERSION", columnDefinition = "INT DEFAULT 0")
    private Integer version;




}
